package day25;

import java.util.LinkedList;
import java.util.List;

/**
 * @ClassName Soluton
 * @Description 遍历 + 存储
 * @Author clockTown
 * @Date 2021/6/3 19:17
 * @Version 1.0
 */
public class Solution {
    public ListNode middleNode(ListNode head) {
        List<ListNode> list = new LinkedList<>();

        while (head != null){
            list.add(head);
            head = head.next;
        }

        return list.get(list.size() / 2);
    }
}
